package school;

import java.util.ArrayList;
import java.util.Random;

public class Group {
    private ArrayList<Student>Students;
    private int groupId;
    public Group(int groupId){
        this.groupId = groupId;
        Students = new ArrayList<>();
    }
    public int getGroupId(){
        return  groupId;
    }
    public void addstudent(Student student){
        Students.add(student);
    }
    public Student getRandomStudent() {
        if (Students.isEmpty())
            return null;
        Random random = new Random();
        return Students.get(random.nextInt(Students.size()));
    }
    public int GetGroup(){
        return groupId;
    }
}
